package com.github.jspxnet.worktask.core.job;

import com.github.jspxnet.txweb.util.MemberUtil;
import com.github.jspxnet.worktask.model.enums.FlowNodeEnumType;
import com.github.jspxnet.worktask.model.enums.WorkTaskEnumType;

public class ThirdJobTask extends BaseTaskAction{
    @Override
    public boolean execute() throws Exception {
        if (workTaskParam.getUserId().equals(MemberUtil.getUserId(currentWorkTask.getUsers())))
        {
            currentWorkTask.setUsers(workTaskParam.getUsers());
            currentWorkTask.setWorkTaskType(WorkTaskEnumType.THIRD.getValue());
            currentWorkTask.setFlowNodeType(FlowNodeEnumType.END.getValue());
            runtimeServiceDAO.update(currentWorkTask,new String[]{"flowNodeType","workTaskType","users"});
            return true;
        }
        return false;
    }
}
